using System;
using System.Reflection;

namespace Common.Core.Objects
{
	[AttributeUsage( AttributeTargets.Class, AllowMultiple = true )]
	public abstract class DefaultPropertyValueAttributeBase : Attribute
	{
		readonly string propertyName;

		protected DefaultPropertyValueAttributeBase( string propertyName )
		{
			this.propertyName = propertyName;
		}

		protected internal abstract object GetValue( PropertyInfo property );

		public string PropertyName
		{
			get { return propertyName; }
		}
	}

	/*public class DependencyDefaultPropertyValue : DefaultPropertyValueAttributeBase
	{
		public DependencyDefaultPropertyValue( string propertyName ) : base( propertyName )
		{}

		public string BuildKeyName { get; set; }

		protected internal override object GetValue( PropertyInfo property, IBuilderContext context )
		{
			IBuilderContext clone =
				context.CloneForNewBuild( new NamedTypeBuildKey( property.PropertyType, BuildKeyName ), null );
			context.SetBuildSource( null );
			object result = clone.Strategies.ExecuteBuildUp( clone );
			return result;
		}
	}*/

}